<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <title>在线考试系统</title>
    <!-- 引入样式 -->
    <link href="//openexamcdn.open.com.cn/openexam/static/App/style/logo.css" rel="stylesheet"/>
    <link href="//openexamcdn.open.com.cn/openexam/static/App/style/promise/promise.css" rel="stylesheet"/>
    <!-- 引入脚本 -->
    <script src="//openexamcdn.open.com.cn/openexam/static/assets/scripts/ShieldBackspace.js"></script>
    <script src="//openexamcdn.open.com.cn/openexam/static/Scripts/jquery-1.12.4.min.js"></script>
    <script src="//openexamcdn.open.com.cn/openexam/static/App/scripts/common.js"></script>
</head>
<body>
<div class="winH">
    <div class="toparea">
        <div class="con">
            <div class="logo">
                <img src="//openexamcdn.open.com.cn/openexam/static/App/images/Login/openLogo.png"/>
            </div>
            <div class="subtitle"></div>
        </div>
    </div>
    <div class="part1">
        <div class="con">
            <div class="boxwrap">
                <div class="tit">考试承诺书</div>
                <ul class="info">
                    <li>考生姓名: ${viewBag.stuName}</li>
                    <li>性别: <span class="sex"></span></li>
                    <li>准考证号: ${viewBag.examCardNo}</li>
                    <li>身份证号: ${viewBag.idCard}</li>
                </ul>
                <div class="duibi">
                    <div class="pho">
                        <img src="/images/${viewBag.examinerHeadPhotoUrl}"
                             onerror="this.src='//openexamcdn.open.com.cn/openexam/static/App/images/Login/defaultPhoto.jpg';this.onerror=null;"/>
                        <br/>
                        考试证件照
                    </div>
                    <div class="pho compareImg">
                        <img id="faceComparePhoto" src=""/>
                        <br/>
                        现场拍照
                    </div>
                    <div class="result">
                        <p class="line_bg"><em class="line_cur"></em></p>
                        <p>系统照片相似度比对结果：<span class="score">${viewBag.score}%</span></p>
                    </div>
                    <!--<ul class="info2">
                        <li>考生姓名: ${viewBag.stuName}</li>
                        <li>性&nbsp;&nbsp;别: <span class="sex"></span></li>
                        <li>准考证号: ${viewBag.examCardNo}</li>
                        <li>身份证号: ${viewBag.idCard}</li>
                    </ul>-->
                </div>
                <div class="list">
                    <p class="t1">《诚信考试承诺书》</p>
                    <p>诚实守信，是中华民族传统美德，是自觉培育和践行社会主义核心价值观的要求。作为一名大学生，我们应该以诚为本，忠实不欺，行之以德，诚信做人，具备良好的道德品质和人格。为此，我郑重承诺并且一定做到：</p>
                    <p>一、严格遵守国家和学校制定的考试管理规定和考生守则，坚决服从考务老师的管理;</p>
                    <p>二、确认是本人参加考试，不请他人或者为他人代考;</p>
                    <p>三、考试过程中不适用通讯设备查阅或传输资料;</p>
                    <p>四、不抄袭或者协助他人抄袭;</p>
                    <p>五、保证在考试中诚实守信，自觉遵守考试有关规定。</p>
                    <p>如有违纪违规行为，自愿按照学校的有关规定接受处理。</p>
                    <br>
                    <p class="bot1">承诺人 : <span>${viewBag.stuName}</span></p>
                    <p class="bot2">学&emsp;号 : <span>${viewBag.examCardNo}</span></p>
                </div>
                <div class="btnBox">
                    <input type="button" value="承诺本人参加考试，并愿意承担相应后果" id="promisebtn" class="promisebtn"/>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    var Token = "${token}";
    var sex = "${viewBag.sex}";
    var score = "${viewBag.score}";
    var faceComparePhoto = "${viewBag.faceComparePhotoUrl}";
    var loginMode = "${viewBag.loginMode}";
    $(function () {
        $(".winH").css({"height":$(window).height()});
        $(".bot1 span").css({"width": $(".bot2").find("span").width() });
        $(".sex").text(sex == 1 ? '男' : '女');
        if(loginMode == "2" || loginMode == "4"){// 登录方式要求人脸识别
            $(".compareImg").hide();
            $(".result").hide();
        }else{
            $(".line_bg .line_cur").css({"width": score + "%"});
            if ($.trim(faceComparePhoto) != "") {
                $("#faceComparePhoto").attr("src", "/images" + faceComparePhoto).error(function () {
                    this.src = '';
                    this.onerror = null;
                });
            }
        }
        $("#promisebtn").click(function () {
            window.location.href = 'ExamPaper?token=' + Token;
        });
    });
</script>
</body>
</html>
